<template>
  <yy-paging v-model="dataList" @query="queryList" ref="paging" :auto="true" @scroll="scroll" :refresher-enabled="true">
    <template #top>
      <u-navbar
        back-text=""
        :is-back="true"
        title="我的反馈"
        :background="{ backgroundColor: isScroll ? '#FFFFFF' : 'transparent' }"
        :border-bottom="false"
        :custom-style="{ transition: 'background-color 0.3s ease-in-out' }"
      >
      </u-navbar>
    </template>
    <view class="flex flex-col gap-4 p-4">
      <view class="bg-[#FFFFFF] rounded-[12px] p-4 flex gap-3 flex-col" v-for="(i, k) in dataList" :key="k">
        <view class="text-[14px] text-[#161A24]"> {{ i.description }}</view>
        <view class="border-t"></view>
        <view class="flex justify-between items-center">
          <view class="text-[13px] text-[#8E9299]">{{ i.create_time_text }}</view>
          <!-- <view class="flex gap-1 items-center">
            <view class="text-[13px] text-[#8E9299]">查看详情</view>
            <view> <u-icon name="arrow-right" size="26" color="#606368"></u-icon> </view>
          </view> -->
        </view>
      </view>
    </view>
  </yy-paging>
</template>

<script>
  export default {
    data() {
      return {
        isScroll: false,
        dataList: [],
        automatic: false
      }
    },

    methods: {
      scroll(e) {
        this.isScroll = e.detail.scrollTop > 0
      },
      async queryList(page, limit) {
        let res = await api.feedbackList({
          page,
          limit
        })
        console.log('🚀 ~ queryList ~ res:', res.data)
        if (!res.code) return
        this.$refs.paging.complete(res.data)
      }
    }
  }
</script>

<style lang="scss" scoped></style>
